<template>
	<view class="vin_con">
		<view class="vin_upload">
			<u-upload :custom-btn="true" :action="action" :show-progress="false" max-count='1' width="702rpx" height="265rpx" :file-list="fileList" @on-remove="remove" @on-success="upData">
				<view slot="addBtn" class="slot-btn">
					<image src="../../static/upload1.png" style="width: 702rpx; height: 265rpx;" mode="widthFix"></image>
					<view class="uploadTxt">
						请上传完整的行驶证/登记证（含VIN部分）进行授权查询
					</view>
				</view>
			</u-upload>
		</view>
		

	</view>
</template>

<script>
	import app from "../../App.vue"
	export default {
		name: 'vin',
		data() {
			return {
				action: getApp().globalData.pictureUpload,
				fileList: [],
				lists: [],
				form:{
					search:""
				}
				
			}
		},
		methods: {
			remove(index, lists, name) {
				this.fileList = lists.map(item => {
					return item.response.data.fileId
				}).join(',')
				console.log(this.fileList)
			},
			upData(data, index, lists, name) {
				console.log(lists);
				this.fileList = lists.map(item => {
					return item.response.data.fileId
				}).join(',')
				console.log(this.fileList)
				this.$emit('fileList',this.fileList)
			},
		}
	}
</script>
<style>
page {
background-color: #fff;
}
</style>
<style lang="scss" >
	.vin_con {
		height: auto;
		box-sizing: border-box;
		margin: $uni-widthspace $uni-widthspace 0px;
		.vin_upload{
			width: 100%;
			height: 265rpx;
			overflow: hidden;
			border-radius: 10rpx;
		}
		.slot-btn {
			width: 702rpx;
			height: 265rpx;
			overflow: hidden;
			border-radius: 10rpx;
			position: relative;

			.uploadTxt {
				position: absolute;
				bottom: 20rpx;
				color: #2C2C2C;
				font-size: 24rpx;
				width: 100%;
				text-align: center;
			}
		}
	
			
	}
</style>
